package cn.signalpha.modules.shop.entity.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public enum CouponUseTypeEnum {

    /**
     * 通用券
     */
    COMMON(1, "平台券"),

    /**
     * 商品券
     */
    GOODS(2, "商品券"),

	/**
	 * 商户券
	 */
	SELLER(3, "商户券");

	private final int type;
	private final String name;

	public static CouponUseTypeEnum instance(int type){
		for(CouponUseTypeEnum couponUseTypeEnum : values()){
			if (couponUseTypeEnum.getType() == type) {
				return couponUseTypeEnum;
			}
		}
		return null;
	}

}
